package com.hpeng.tml.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.hpeng.sys.model.Department;
import com.hpeng.tml.dao.DepartmentDao;
import com.hpeng.tml.service.DepartmentService;
import com.hpeng.util.Pagination;

@Component("deptService")
public class DepartmentServiceImpl implements DepartmentService {
	@Resource
	private DepartmentDao deptDao ;

	public List<Department> findAllDepartment() {
		return deptDao.getAll();
	}
	
	public void save(Department department){
		deptDao.save(department);
	}

	public void delete(String depid) {
		deptDao.remove(depid);
	}

	public void update(Department department) {
		deptDao.update(department);
	}

	public Department findDepartmentById(String depid) {
		return deptDao.get(depid);
	}

	public Pagination<Department> getPagination(int pageNumber,String[] hql,String[] values,String order){
		return deptDao.getPagination(pageNumber, hql, values,order);
	}

}
